#pragma once
#include <windows.h>
#include <string>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <d3d9.h>
#include <d3dx9.h>
#include <DxErr.h>
using namespace std;

#pragma comment(lib,"DxErr.lib")

#ifndef SAFE_RELEASE
	#define SAFE_RELEASE(x) if((x)){ (x)->Release();	 (x) = NULL; } 
#endif
#ifndef SAFE_DELETE
	#define SAFE_DELETE(x) if((x)){ delete (x);(x) = NULL; }
#endif

#define ERRBOX(x) MessageBoxA(0,x,0,0)
#define TRACE(x) OutputDebugStringA(x) 


#if defined (DEBUG) | defined (_DEBUG)
	#ifndef HR
	#define HR(x)															\
		{																	\
			HRESULT hr = x;													\
			if(FAILED((hr))){												\
				DXTraceW(__FILE__,__LINE__,hr,TEXT(#x),true);				\
			}																\
		}												
	#endif
#else
	#ifndef	HR
	#define HR(x) x
	#endif
#endif

//
const string MD5PATH = "../../files/md5Model/";

//
void LoadRaw(string rawfiles,char** inFile,size_t size);

//
void RandomizePos(vector<D3DXVECTOR3>& vecPos,DWORD dwNum);